const fs = require('node:fs')

module.exports = {
  // 数据库配置 (根据自己电脑配置修改)
  database: {
    host: 'localhost',
    username: 'root',
    password: 'root',
    name: 'koa-demo',
    port: 3306,
  },
  // 对象存储配置 (当staticInLocal为false时 图片存储采用该策略)
  oss: {
    secretId: 'AKIDZ1JOFsRwHQN9j7HC3jKqGmBTn2GKCqGS',
    secretKey: 'BANUPXUDl6GVdfU5TioiNoU8hGydMxRo',
    bucket: 'stadium-1308817597',
    region: 'ap-guangzhou',
  },
  // 项目启动相关配置
  server: {
    host: 'localhost',
    port: 2077,
    staticInLocal: true, // 是否把图片等静态资源存储在本地
    pathPrefix: '/api/v2', // 路径前缀
  },
  // token配置
  auth: {
    privateKey: fs.readFileSync('./keys/private.pem'),
    publicKey: fs.readFileSync('./keys/public.pem'),
    expiresIn: '1d', // '1d' 40
  }
}